package io.gitee.zhangbinhub.acp.boot

import io.gitee.zhangbinhub.acp.boot.websocket.AcpWebSocketServer
import org.noear.solon.Solon
import org.noear.solon.annotation.Configuration
import org.noear.solon.annotation.Init
import org.noear.solon.annotation.Inject

@Configuration
class AcpBootAutoConfiguration {
    @Inject
    private var acpWebSocketServerList: MutableList<AcpWebSocketServer> = mutableListOf()

    @Init
    fun init() {
        if (acpWebSocketServerList.isNotEmpty()) {
            Solon.app().enableWebSocket(true)
        }
    }
}